import { Renderer } from "@k8slens/extensions";
import { observer } from "mobx-react";
import React from "react";
import { ingressCheckPreferencesStore } from "./preference-store";

const { Component: { SubTitle, Input } } = Renderer;

@observer
export class IngressCheckPreference extends React.Component {
  render() {
    return (
      <section>
        <SubTitle title="Certificate Expiry Warning Days" />
        <Input
          type="number"
          theme="round-black"
          value={ingressCheckPreferencesStore.expiryDays.toString()}
          onChange={v => {
            ingressCheckPreferencesStore.expiryDays = parseInt(v);
          }}
        />
      </section>
    );
  }
}